home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 235 / Issue 235 - September 2007 - DPCS0907DVD.ISO / Extras / NetObjects Fusion / NOF10.exe / data1.cab / FSI / lib / nof / dataobjects / DataOption.js < prev    next >
Encoding:
JavaScript  |  2007-04-11  |  2.0 KB  |  56 lines

  1. /** Class DataOption
  2. Description : Implement the data option object
  3. */
  4. function NOF_DataOption(_id,_name,_label) {
  5.   this.__proto__ = NOF_DataOption.prototype;  
  6.  
  7.   this.id    = _id;
  8.   this.name  = _name;
  9.   this.label = _label;
  10. }
  11.  
  12. function NOF_DataOption_ProtoBuilder() {
  13.   var member = NOF_DataOption.prototype;
  14.   member.id    = -1;
  15.   member.name  = '';
  16.   member.label = '';
  17.   member.sorted = false;
  18.   member.values = null;
  19.   member.tableId = -1;
  20.   member.position = -1;
  21.   member.isNew = true;
  22.   member.isDirty = true;
  23.   
  24.   var method = NOF_DataOption.prototype;
  25.   
  26.   method.getValues = function getValues ()        { return this.values; } 
  27.   method.setValues = function setValues (_values) { this.values = _values; this.isDirty = true; }
  28.  
  29.   method.getId   = function getId ()              { return this.id; }
  30.   method.setId   = function setId (_id)           { this.id = _id; this.isDirty = true; }
  31.   
  32.   method.getName   = function getName ()          { return this.name; }
  33.   method.setName   = function setName (_name)     { this.name = _name;  this.isDirty = true; }
  34.   
  35.   method.getLabel  = function getLabel ()         { return this.label; }
  36.   method.setLabel  = function setLabel (_label)   { this.label = _label;  this.isDirty = true; }
  37.  
  38.   method.getSorted  = function getSorted ()       { return this.sorted; }
  39.   method.setSorted  = function setSorted (_sorted){ this.sorted = _sorted;  this.isDirty = true; }
  40.   
  41.   method.getPosition = function getPosition ()          { return this.position; }
  42.   method.setPosition = function setPosition (_position) { this.position = _position;  this.isDirty = true; }
  43.   
  44.   method.getTableId = function getGetTableId ()         { return this.tableId; }
  45.   method.setTableId = function setTableId (_tableId)    { this.tableId = _tableId;  this.isDirty = true;  }  
  46.   
  47.   method.equals = function equals (obj) {
  48.     if (this.name == obj.name)
  49.       return true;
  50.     return false;
  51.   }
  52. }
  53.  
  54. NOF_DataOption_ProtoBuilder();
  55. NOF.__proto__.DataOption = NOF_DataOption;
  56.